﻿using UnityEngine;
using System.Collections;

public class ObjectivePlayerDies : MonoBehaviour, ILevelObjective {

	private Level theLevel;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public bool ObjectiveAchieved()
	{
		GameObject theHero = theLevel.Hero;

		Entity entityData = theHero.GetComponent<Entity>();

		if (entityData.Hp <= 0)
			return true;

		return false;
	}
	
	public void SetLevel(Level level)
	{
		theLevel = level;
	}
}
